import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { RegisterComponent } from './pages/register/register.component';
import { ForgetpwdComponent } from './pages/forgetpwd/forgetpwd.component';
// import { NOpage404Component } from './pages/nopage404/nopage404.component';
import { LoginguardService } from './services/loginguard.service';


const routes: Routes = [
  { path: '', redirectTo: '/login', pathMatch: 'full' },
  { path: 'login', component: LoginComponent },
  { path: 'register', component: RegisterComponent},
  { path: 'main', loadChildren: './pages/main/main.module#MainModule',canActivate: [LoginguardService] },
  { path: 'forgetpwd',component: ForgetpwdComponent },
  // { path: 'page404', component: NOpage404Component },
  // { path: '**', component: NOpage404Component }
];
@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule { }
